<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('查看产品类别')"/>
    <th:block th:include="include :: datetimepicker-css"/>
    <style>
        div .col-sm-8 span {
            color: darkgrey;
        }
    </style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-product-edit" th:object="${oProduct}">
        <div class="form-group">
            <label class="col-sm-3 control-label ">排序：</label>
            <div class="col-sm-8">
                <input name="sortOrder" class="form-control" type="text" th:field="*{sortOrder}" readonly>
                <span class="sortOrder">数字越大排的越前面,范围0-999</span>
            </div>
        </div>
        <div class="form-group" style="display: none">
            <label class="col-sm-3 control-label ">资源目录：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" id="treeName" readonly="true" th:field="*{resourceName}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">产品名称：</label>
            <div class="col-sm-8">
                <input name="productName" class="form-control" type="text" th:field="*{productName}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">产品类别：</label>
            <div class="col-sm-8" th:with="type=${@dict.getType('product_type')}">
                <input name="productType" class="form-control" type="text" th:each="dict:${type}"
                       th:if="${dict.dictValue} eq *{productType}" th:value="${dict.dictLabel}" readonly>
                <input name="productType" class="form-control" type="text" readonly >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">发布单位：</label>
            <div class="col-sm-8">
                <input name="productDepartment" class="form-control" type="text" th:field="*{productDepartment}"
                       readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">预报类型：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" th:each="type:${forecastTypes}" th:value="${type.typeName}"
                       th:if="${type.typeCode} eq *{forecastType}" readonly>
                <!--                    <input name="forecastType" class="form-control" type="text" >-->
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">产品类型：</label>
            <div class="col-sm-8">
                <input name="productItem" class="form-control" type="text" th:each="type:${productTypes}" th:value="${type.productName}"
                       th:if="${type.productCode} eq *{productItem}" readonly>
                <input name="productItem" class="form-control" type="text" readonly >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">覆盖海区：</label>
            <div class="col-sm-8">
                <input id="oceanName" class="form-control" type="text" readonly th:field="*{oceanName}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">预报时效：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" th:each="aging:${agings}" th:value="${aging.name}"
                       th:if="${aging.code} eq *{forecastAging}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-reuqired">预报要素：</label>
            <div class="col-sm-8" th:checked="true" id="element">
                <input name="forecastElement" type="checkbox" th:each="element:${elements}"
                       th:value="${element.englishAbbreviations}" th:text="${element.elementName}"
                       th:checked="${oProduct.forecastElement.contains(element.englishAbbreviations)}" disabled>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">产品模式：</label>
            <div class="col-sm-8">
                <input id="modeName" class="form-control" type="text" readonly th:field="*{modeName}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">命名规则：</label>
            <div class="col-sm-8">
                <input name="nameRule" class="form-control" type="text" th:field="*{nameRule}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">文件格式：</label>
            <div class="col-sm-8">
                <input name="fileType" class="form-control" type="text" th:field="*{fileType}" readonly>
                <span class="nameRule">只有nc格式的文件会进行头文件识别和裁切</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">分辨率：</label>
            <div class="col-sm-8">
                <input name="resolution" class="form-control" type="text" th:field="*{resolution}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">起报时间：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" th:each="frequency:${frequencies}" th:value="${frequency.name}"
                       th:if="${frequency.code} eq *{frequency}" readonly>
                <span class="frequency">对应产品命名规则YYYYMMDDHH字段中的HH</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">时间间隔：</label>
            <div class="col-sm-8">
                <input name="forecastInterval" class="form-control" type="text" th:each="interval:${forecastIntervals}"
                       th:value="${interval.name}"
                       th:if="${interval.code} eq *{forecastInterval}" readonly>
                <input name="forecastInterval" class="form-control" type="text" readonly >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">文件大小：</label>
            <div class="col-sm-8">
                <input name="fileSize" class="form-control" type="text" placeholder="MB" th:field="*{fileSize}"
                       readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">上限阈值：</label>
            <div class="col-sm-8">
                <input name="maxFileSize" class="form-control" type="text" placeholder="%(百分比)"
                       th:field="*{maxFileSize}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">下限阈值：</label>
            <div class="col-sm-8">
                <input name="minFileSize" class="form-control" type="text" placeholder="%(百分比)"
                       th:field="*{minFileSize}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">启用阈值：</label>
            <div class="col-sm-8" th:with="type=${@dict.getType('yes_or_no')}">
                <input name="isOpenThreshold" type="radio" th:each="dict:${type}"
                       th:value="${dict.dictValue}" th:text="${dict.dictLabel}"
                       th:checked="${dict.dictValue} eq *{isOpenThreshold}" disabled>
            </div>
        </div>
        <!--<div class="form-group">
            <label class="col-sm-3 control-label">左下经度/纬度：</label>
            <div class="col-sm-4">
                <input name="leftUpLongitude" class="form-control" type="text" th:field="*{leftUpLongitude}" readonly>
            </div>
            <div class="col-sm-4">
                <input name="leftUpLatitude" class="form-control" type="text" th:field="*{leftUpLatitude}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">右上经度/纬度：</label>
            <div class="col-sm-4">
                <input name="rightDownLongitude" class="form-control" type="text" th:field="*{rightDownLongitude}"
                       readonly>
            </div>
            <div class="col-sm-4">
                <input name="rightDownLatitude" class="form-control" type="text" th:field="*{rightDownLatitude}"
                       readonly>
            </div>
        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">自动发布：</label>
            <div class="col-sm-8" th:with="type=${@dict.getType('yes_or_no')}">
                <input name="isAuto" type="radio" th:each="dict:${type}"
                       th:value="${dict.dictValue}" th:text="${dict.dictLabel}"
                       th:checked="${dict.dictValue} eq *{isAuto}" disabled>
            </div>
        </div>
      <!--  <div class="form-group">
            <label class="col-sm-3 control-label">是否可预览：</label>
            <div class="col-sm-8" th:with="type=${@dict.getType('yes_or_no')}">
                <input name="isPreview" type="radio" th:each="dict:${type}"
                       th:value="${dict.dictValue}" th:text="${dict.dictLabel}"
                       th:checked="${dict.dictValue} eq *{isPreview}" disabled>
            </div>
        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">是否前端显示：</label>
            <div class="col-sm-8" th:with="type=${@dict.getType('yes_or_no')}">
                <input name="isOpen" type="radio" th:each="dict:${type}"
                       th:value="${dict.dictValue}" th:text="${dict.dictLabel}"
                       th:checked="${dict.dictValue} eq *{isOpen}" disabled>
            </div>
        </div>
       <!-- <div class="form-group">
            <label class="col-sm-3 control-label">是否永久保存：</label>
            <div class="col-sm-8" th:with="type=${@dict.getType('yes_or_no')}">
                <input name="isForeverSave" type="radio" th:each="dict:${type}"
                       th:value="${dict.dictValue}" th:text="${dict.dictLabel}"
                       th:checked="${dict.dictValue} eq *{isForeverSave}" disabled>
            </div>
        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">是否检查更新：</label>
            <div class="col-sm-8" th:with="type=${@dict.getType('yes_or_no')}">
                <input name="isJoinHistory" type="radio" th:each="dict:${type}"
                       th:value="${dict.dictValue}" th:text="${dict.dictLabel}"
                       th:checked="${dict.dictValue} eq *{isJoinHistory}" disabled>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">检查更新天数：</label>
            <div class="col-sm-8">
                <input name="notUpdateCheckDays" class="form-control" type="text" th:each="day:${historyDays}" th:value="${day.historyDays}"
                       th:if="${day.historyCode} eq *{notUpdateCheckDays}" readonly>
                <input name="notUpdateCheckDays" class="form-control" type="text" readonly >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">判断晚传时间设置：</label>
            <div class="col-sm-8">
                <input name="wcsz" class="form-control" type="text" th:field="*{wcsz}">
                <span class="checkConfig">晚传设置：设置格式举例：0_18_0900 ，表示每天早9点（北京时）检查该产品起报时为前一日18时的文件。说明：第一字段的一位数为0或1，0表示要检查的文件起报时间在检查时间的前一日，1表示为同日；中间字段的两位数为文件起报时间（小时）；最后四位数表示在每天xx点xx分（北京时）进行检查。若有多个设置，请用英文逗号分隔。</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">归档超时提醒设置：</label>
            <div class="col-sm-8">
                <input name="checkConfig" class="form-control" type="text" th:field="*{checkConfig}" readonly>
                <span class="checkConfig">归档检查时间设置：此处设置每日文件在云平台的归档检查时间，若对应文件在设置时间未成功归档，系统将向产品负责人发送Email及短信提醒。设置格式举例：0_18_0900 ，表示每天早9点（北京时）检查该产品起报时为前一日18时的文件。说明：第一字段的一位数为0或1，0表示要检查的文件起报时间在检查时间的前一日，1表示为同日；中间字段的两位数为文件起报时间（小时）；最后四位数表示在每天xx点xx分（北京时）进行检查。若有多个设置，请用英文逗号分隔。
                 </span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">晚传检查时间设置：</label>
            <div class="col-sm-8">
                <input name="lateTransmission" class="form-control" type="text" th:each="time:${productLateTimes}" th:value="${time.lateName}"
                       th:if="${time.lateCode} eq *{lateTransmission}" readonly>
                <input name="lateTransmission" class="form-control" type="text" readonly >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">补传检查时间设置：</label>
            <div class="col-sm-8">
                <input name="repairTransmission" class="form-control" type="text" th:each="time:${repairTimes}" th:value="${time.repairName}"
                       th:if="${time.repairCode} eq *{repairTransmission}" readonly>
                <input name="repairTransmission" class="form-control" type="text" readonly >
                <span class="repairTransmission">若产品文件在晚传检查时间仍未成功归档，则从归档检查时间开始经过此时间段后系统将进行补传检查。若文件在补传检查时间前上传并成功归档，则该文件上传状态会转为补传。
                 </span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">补传短信提醒日：</label>
            <div class="col-sm-8">
                <input name="repairTipSmsDay" class="form-control" type="text" th:each="time:${repairTimes}" th:value="${time.repairCode}"
                       th:if="${time.repairCode} eq *{repairTipSmsDay}" readonly>
                <input name="repairTipSmsDay" class="form-control" type="text" readonly >
                <span class="repairTipSmsDay">若产品文件在晚传检查时间仍未成功归档，将于该提醒日（归档检查时间后第x日）发送短信对负责人进行提醒，设置的提醒日不能大于补传检查时间
                 </span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否归档解压：</label>
            <div class="col-sm-8">
                <div class="col-sm-8" th:with="type=${@dict.getType('yes_or_no')}">
                    <input name="isUnzip" type="radio" th:each="dict:${type}"
                           th:value="${dict.dictValue}" th:text="${dict.dictLabel}"
                           th:checked="${dict.dictValue} eq *{isUnzip}" disabled>
                </div>
                <!--                    <input name="isUnzip" class="form-control" type="text">-->
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">短信提醒电话：</label>
            <div class="col-sm-8">
                <input name="smsTipPhone" class="form-control" th:field="*{smsTipPhone}" readonly></input>
                <span class="smsTipPhone">多个电话间用英文逗号分隔</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">提醒邮箱设定：</label>
            <div class="col-sm-8">
                <input name="sendMail" class="form-control" th:field="*{sendMail}" readonly></input>
                <span class="sendMail">多个邮箱地址间用英文逗号分隔</span>
            </div>
        </div>
      <!--  <div class="form-group">
            <label class="col-sm-3 control-label">可预览/下载单位：</label>
            <div class="col-sm-8">
                    <input name="departIds" type="checkbox" th:each="dept:${deptList}" th:text="${dept.deptName}"
                           th:checked="${#strings.contains(oProduct.departIds,dept.deptId)}" disabled>
            </div>
        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label ">产品简要介绍：</label>
            <div class="col-sm-8">
                <textarea name="productDrief" class="form-control" style="height: 150px" th:field="*{productDrief}"
                          readonly></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:src="@{/static/ocean/js/add.js}" type="text/javascript"></script>
<script th:inline="javascript">
    var prefix = ctx + "product/product"

    $(function () {
        hide($("input[name=productType]"));
        hide($("input[name=productItem]"));
        hide($("input[name=forecastInterval]"));
        hide($("input[name=notUpdateCheckDays]"));
        hide($("input[name=lateTransmission]"));
        hide($("input[name=repairTransmission]"));
        hide($("input[name=repairTipSmsDay]"));
    })
    function hide(_this) {
        if (_this.length>1){
            _this[1].style.display = 'none';
        }
    }
    /*
            $("#form-product-add").validate({
                focusCleanup: true
            });
    */

    /*
        $("input[name='createDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='updateDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    */

</script>
</body>
</html>
